package com.svms.service.vo;

public class SpareAlertVO extends AlertVO {

	private VehicleSpareVO sparesVO;

	private VehicleSpareVO getSparesVO() {
		return sparesVO;
	}

	public void setSparesVO(VehicleSpareVO sparesVO) {
		this.sparesVO = sparesVO;
	}

	public String getVehicleNumber() {
		String vehcileNumber = null;
		if (getSparesVO() != null) {
			vehcileNumber = getSparesVO().getVehicleVO().getVehicleId();
		}
		return vehcileNumber;
	}

	public String getSpareName() {
		String spareName = null;
		if (getSparesVO() != null) {
			spareName = getSparesVO().getSpareId();
		}
		return spareName;
	}

	@Override
	public String toString() {
		return "SpareAlertVO [sparesVO=" + sparesVO + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result
				+ ((sparesVO == null) ? 0 : sparesVO.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		SpareAlertVO other = (SpareAlertVO) obj;
		if (sparesVO == null) {
			if (other.sparesVO != null)
				return false;
		} else if (!sparesVO.equals(other.sparesVO))
			return false;
		return true;
	}

}
